import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import '@/assets/css/public.css' // 公共样式
import '@/assets/css/vant-custom.less' // 样式覆盖
import tools from '@/assets/js/tools.js' // 工具类
// import { request } from '@/assets/js/request.js' // 网络请求
import axios from 'axios'
Vue.prototype.$axios = axios    //把axios挂载到vue的原型中，在vue中每个组件都可以使用axios发送请求
if (process.env.NODE_ENV === 'dev') {
  Vue.prototype.HOME = '/api/'
} else {
  Vue.prototype.HOME = ''
}

Vue.config.productionTip = false
// Vue.prototype.$request = request
Vue.prototype.$tools = tools


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

window.addEventListener('popstate', function() {
  router.isBack = true
})

document.addEventListener('DOMContentLoaded', function() {
  if (window.innerWidth > 750 && !navigator.userAgent.match(/(Android|iPhone|iPad)/i)) document.documentElement.style.fontSize = '130px'
})
